package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: sky-take-out
 * @description:
 * @author: fmp
 * @create: 2023-04-09 15:10
 * @Version 1.0
 **/
@Mapper
public interface ShopCartMapper {
    //查看用户车
    List<ShoppingCart> selectShopCart(@Param("conditionShoppingCart") ShoppingCart shoppingCart);
    //添加购物车

    //通过dishid查询
    ShoppingCart selectByDishId(@Param("dishId") Long dishId);
    //通过setmaelid查询
    ShoppingCart selectBySetmealId(@Param("setmealId") Long setmealId);
    //通过userid清空购物车
    void CleanShoppingCart(@Param("userId") Long userId);
    //根据dishid删除
    void deleteByDishId(@Param("shoppingCartDTO")ShoppingCartDTO shoppingCartDTO );
    //根据SetmealId删除本条数据
    void deleteBYSetmealId(@Param("setmealId") Long setmealId);

    void UpdateNumber(@Param("shoppingCart1") ShoppingCart shoppingCart1);

    void InsertShoppingCart(@Param("shoppingCart") ShoppingCart shoppingCart);

    ShoppingCart selectByDishIdAnnFlovar(@Param("shoppingCartDTO") ShoppingCartDTO shoppingCartDTO);


}
